package com.google.demo.model;

import android.os.Bundle;

public class InputData {
	String mLat;
	String mLon;
	String mQRCode;
	int mSalesOfPhonesThisMonth;
	int mSalesOfSimsThisMonth;
	int mSalesOfCardsThisMonth;
	
	public static final String KEY_LAT = "key_lat";
	public static final String KEY_LON = "key_lon";
	public static final String KEY_QRCODE = "key_QRCode";
	public static final String KEY_SALESOFPHONESTHISMONTH = "key_SalesOfPhonesThisMonth";
	public static final String KEY_SALESOFSIMSTHISMONTH = "key_SalesOfSimsThisMonth";
	public static final String KEY_SALESOFCARDSTHISMONTH = "key_SalesOfCardsThisMonth";
	
	public InputData() {
		mLat = "200";
		mLon = "0";
		mQRCode = "";
		mSalesOfPhonesThisMonth = 0;
		mSalesOfSimsThisMonth = 0;
		mSalesOfCardsThisMonth = 0;
	}
	
	public String getLat() {
		return mLat;
	}

	public void setLat(String lat) {
		this.mLat = lat;
	}
	
	public String getLon() {
		return mLon;
	}

	public void setLon(String lon) {
		this.mLon = lon;
	}
	
	public String getQRCode() {
		return mQRCode;
	}

	public void setQRCode(String QRCode) {
		this.mQRCode = QRCode;
	}
	
	public int getSalesOfPhonesThisMonth() {
		return mSalesOfPhonesThisMonth;
	}

	public void setSalesOfPhonesThisMonth(int salesOfPhonesThisMonth) {
		this.mSalesOfPhonesThisMonth = salesOfPhonesThisMonth;
	}
	
	public int getSalesOfSimsThisMonth() {
		return mSalesOfSimsThisMonth;
	}

	public void setSalesOfSimsThisMonth(int salesOfSimsThisMonth) {
		this.mSalesOfSimsThisMonth = salesOfSimsThisMonth;
	}
	
	public int getSalesOfCardsThisMonth() {
		return mSalesOfCardsThisMonth;
	}

	public void setSalesOfCardsThisMonth(int salesOfCardsThisMonth) {
		this.mSalesOfCardsThisMonth = salesOfCardsThisMonth;
	}
	
	public static Bundle putInputDataToBundle(InputData inputData)
	{
		Bundle bundle = new Bundle();
		if(inputData == null)
			return bundle;
		bundle.putString(KEY_LAT, inputData.getLat());
		bundle.putString(KEY_LON, inputData.getLon());
		bundle.putString(KEY_QRCODE, inputData.getQRCode());
		bundle.putInt(KEY_SALESOFPHONESTHISMONTH, inputData.getSalesOfPhonesThisMonth());
		bundle.putInt(KEY_SALESOFSIMSTHISMONTH, inputData.getSalesOfSimsThisMonth());
		bundle.putInt(KEY_SALESOFCARDSTHISMONTH, inputData.getSalesOfCardsThisMonth());
		return bundle;
	}
	
	public static InputData getInputDataFromBundle(Bundle bundle)
	{
		InputData inputData = new InputData();
		if(bundle == null)
			return inputData;
		inputData.setLat(bundle.getString(KEY_LAT));
		inputData.setLon(bundle.getString(KEY_LON));
		inputData.setQRCode(bundle.getString(KEY_QRCODE));
		inputData.setSalesOfPhonesThisMonth(bundle.getInt(KEY_SALESOFPHONESTHISMONTH, 0));
		inputData.setSalesOfSimsThisMonth(bundle.getInt(KEY_SALESOFSIMSTHISMONTH, 0));
		inputData.setSalesOfCardsThisMonth(bundle.getInt(KEY_SALESOFCARDSTHISMONTH, 0));
		return inputData;
	}
}
